package com.wanmait.demo.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.demo.mapper.WorkerMapper;
import com.wanmait.demo.pojo.Worker;
import com.wanmait.demo.service.WorkerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class WorkerServiceimpl implements WorkerService {

//zjj
    @Override
    public Worker zjjfindById(Integer id) {

        Worker worker= null;
        try {
            worker = workerMapper.zjjselectByPrimaryKey(id);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("qqq  "+worker.toString());
        return worker;
    }






    @Resource
    private WorkerMapper workerMapper;
    @Override
    public void insert(Worker object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Worker object) {

    }

    @Override
    public Worker findById(Integer id) {
        return null;
    }

    @Override
    public List<Worker> findAll() {
        return workerMapper.selectList();
    }
    /*查找维修人员的手机号和密码*/
    @Override
    public Worker findPhoneNumberAndUserPass(Worker worker){
        return workerMapper.findPhoneNumberAndUserPass(worker);
    }

    @Override
    public Worker selectworker(Integer workid) {
        return workerMapper.selectworker(workid);
    }

    @Override
    public PageInfo<Worker> findPage(int pageNum, int pageSize) {
        return null;
    }
}
